/*
	对象数组
*/
#include <iostream>
#include <cstring>

using namespace std;

class Person {
	private:
		int age;
		char * name;

	public:
		~Person();
		void assignment(const char * a, int b);
		void show();
};

Person::~Person() {
	delete [] name;
}

void Person::assignment(const char * a="You beat", int b=199) {
	name = new char[strlen(a)+1];
	strcpy(name, a);
	name[strlen(a)] = '\0';
	age = b;

	return ;
}

void Person::show() {
	cout << name << " : " << age << endl;
}

int main(int argc, char * argv[]) {
	Person m[2];
	m[0].assignment("I'm MT", 998);

	m[0].show();

	m[1].assignment();
	m[1].show();

	return 0;
}
